import { Vue, Component, Watch } from 'vue-property-decorator'
import { TopNav, QuestionBank } from '@/components/index'
import { cloneDeep } from 'lodash'
import templateData from './formData'
@Component({
    components: {
        TopNav, QuestionBank
    }
})
export default class visitorRegistration extends Vue {
    private checked = false
    private active = 0
    private formData = [cloneDeep(templateData)]

    private setClassL = ''
    private setClassR = ''
    @Watch('active')
    onactive(v: number) {
        if (v == 1) {
            this.setClassL = 'slideInRight'
            this.setClassR = 'slideInLeft'
        } else {
            this.setClassL = 'slideInRight'
            this.setClassR = 'slideInLeft'
        }
    }

    addFriend() {
        let temp = cloneDeep(templateData)
        this.formData.push(temp)

    }
    removeFriend(i: number) {
        this.formData = this.formData.filter((e, index) => {
            if (i != index) {
                return e
            }
        })
    }
    submit(){
        this.$router.push('/confirmation')
    }

}